package projectUtils;

public class ColorUtil {
	
	public static int RGBToGreyScale(int rgb)
	{
		int red   = (rgb >> 16) & 0xff; 
		int green = (rgb >>  8) & 0xff; 
		int blue  = (rgb      ) & 0xff;
		//return ((red + green + blue) / 3);
		return (int)Math.round((0.2989 * (double)red + 0.5870 * (double)green + 0.1140 * (double)blue));
	}
	
}
